<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isFold ? '60px' : '210px'">
        <nav-menu :is-fold="isFold" />
      </el-aside>
      <el-container>
        <el-header height="48px">
          <nav-header @fold-change="handleFoldChange" />
        </el-header>
        <el-main>
          <!-- 菜单路由映射 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts" name="main">
import { ref } from 'vue'
import NavMenu from '@/components/nav-menu/nav-menu.vue'
import useLoginStore from '@/store/login'
import router from '@/router'
const isFold = ref(false)
/**
 *
 * @param isFoldValue 处理菜单折叠的变化
 */
function handleFoldChange(isFoldValue: boolean) {
  isFold.value = isFoldValue
}
const loginStore = useLoginStore()
// loginStore.loadLocalDataAction()
</script>

<style scoped lang="less">
.main {
  width: 100%;
  height: 100%;
}

.main-content {
  height: 100%;

  .el-aside {
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 200px;
    text-align: left;
    cursor: pointer;
    background-color: #001529;
    transition: width 0.3s linear;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */

    &::-webkit-scrollbar {
      display: none;
    }
  }

  .el-main {
    background-color: #f0f2f5;
  }
}
</style>
